import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('resources', { schema: 'db_lowcode' })
export class Resources {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: '资源ID' })
  id: number;

  @Column('varchar', { name: 'url', comment: 'URL', length: 100 })
  url: string;

  @Column('int', { name: 'account_id', comment: '账户ID' })
  accountId: number;

  @Column('tinyint', { name: 'type', comment: '类型' })
  type: number;

  @Column('varchar', { name: 'name', comment: '名称', length: 50 })
  name: string;

  @Column('timestamp', {
    name: 'create_time',
    comment: '创建时间',
    default: () => 'CURRENT_TIMESTAMP',
  })
  createTime: Date;

  @Column('timestamp', {
    name: 'update_time',
    comment: '更新时间',
    default: () => 'CURRENT_TIMESTAMP',
  })
  updateTime: Date;
}
